import request from '@/utils/taskhttp'
import api from "@/utils/taskapi"

// 获取业务场景全部数据（带子级）
export function getAllList(data, success) {
    request(api.getGroupScene, data, (res => {
        success(res)
    }))
}

export function getOpenScene(data, success) {
    request(api.getGroupOpenScene, data, (res => {
        success(res)
    }))
}

// 获取业务数据
export function getSceneList(data, success) {
    request(api.getTaskGroupList, data, (res => {
        success(res)
    }))
}

// 获取业务数据
export function getGroupValue(data, success) {
    request(api.getTaskGroupValue, data, (res => {
        success(res)
    }))
}


// 新增业务 参数groupName
export function addBsiness(data, success) {
    request(api.createTaskGroup, data, (res => {
        success(res)
    }))
}

// 删除业务
export function delBsiness(data, success) {
    request(api.deleteTaskGroup, data, (res => {
        success(res)
    }))
}

// 新增场景
export function addScene(data, success) {
    request(api.createTaskScene, data, (res => {
        success(res)
    }))
}

//编辑业务
export function updateGroup(data, success) {
    request(api.updateTaskGroup, data, (res => {
        success(res)
    }))
}

//编辑场景
export function updateScene(data, success) {
    request(api.updateTaskScene, data, (res => {
        success(res)
    }))
}

// 禁用（开关）
export function updateStatus(data, success) {
    request(api.updateSceneStatus, data, (res => {
        success(res)
    }))
}

//创建任务配置
export function createType(data, success) {
    request(api.createTypeConfig, data, (res => {
        success(res)
    }))
}

// 编辑配置任务
export function editType(data, success) {
    request(api.updateTypeConfig, data, (res => {
        success(res)
    }))
}

// 更新状态
export function updateConfigStatus(data, success) {
    request(api.updateConfigStatus, data, (res => {
        success(res)
    }))
}
// 获取分类列表
export function getTypeConfigList(data, success) {
    request(api.getTypeConfigList, data, (res => {
        success(res)
    }))
}

// 获取优惠券列表数据
export function getVoucherList(data, success) {
    request(api.getVoucherList, data, (res => {
        success(res)
    }))
}

// 公众号模板列表接口
export function getWeChatTemplateList(data, success) {
    request(api.getWeChatTemplateList, data, (res => {
        success(res)
    }))
}
// 公众号推文接口
export function getWeChatGraphicMsgList(data, success) {
    request(api.getWeChatGraphicMsgList, data, (res => {
        success(res)
    }))
}
// 人群包接口
export function getPeopleList(data, success) {
    request(api.getPeopleList, data, (res => {
        success(res)
    }))
}